<!-- 危化品管理-危废品进出-存储监控 -->
<template>
  <div class="JNPF-common-layout">
    <div class="JNPF-common-layout-center">
      <el-row class="JNPF-common-search-box" :gutter="16">
        <el-form @submit.native.prevent>

          <el-col :span="6">
            <el-form-item label="仓库">
              <el-select v-model="fstockname" placeholder="请选择"
                :disabled="$store.getters.userInfo.manufacturer">
                <el-option
                  v-for="item in options2"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>


          <template v-if="showAll">

            <el-col :span="6">
            <el-form-item label="教学楼">
              <el-select v-model="listQuery.fcustomno" placeholder="请选择"
                :disabled="$store.getters.userInfo.manufacturer">
                <el-option
                  v-for="item in options1"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="场地名称">
              <el-input v-model="listQuery.fpoint" placeholder="请输入" clearable />
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="危废名称">
              <el-input v-model="listQuery.fcatno" placeholder="请输入" clearable />
            </el-form-item>
          </el-col>

        </template>

          <el-col :span="12">
            <el-form-item label="">
              <el-button type="primary" icon="el-icon-search" @click="getlist">查询</el-button>
              <!-- <el-button type="success" icon="el-icon-plus" @click="insert(undefined)">新增</el-button> -->
              <!-- <el-button type="warning" icon="el-icon-upload2">导入</el-button> -->
              <el-button type="text" icon="el-icon-arrow-down" @click="showAll = true" v-if="!showAll">展开</el-button>
              <el-button type="text" icon="el-icon-arrow-up" @click="showAll = false" v-else>收起</el-button>
            </el-form-item>
          </el-col>

          <!-- el-image组件支持懒加载功能,只需设置lazy属性: -->
          <el-col :span="24">
           <div class="demo-image">
            <el-image
              style="width: 100%; height: 160px"
              :src="url"
              :fit="fit"
              lazy></el-image>
           </div>
         </el-col>

        </el-form>
      </el-row>
      <div class="JNPF-common-layout-main JNPF-flex-main">
        <JNPF-table :data="list" border v-loading="loading">
          <el-table-column prop="FSTOCK" label="存放仓库" ></el-table-column>
          <el-table-column prop="FCATNAME" label="危废名称" ></el-table-column>
          <el-table-column prop="FNUM" label="存放数量(桶)" ></el-table-column>
          <el-table-column prop="FWEIGHT" label="存放重量(kg)" ></el-table-column>
          <el-table-column fixed="left" label="操作" width="100">
            <template slot-scope="scope">
              <el-button @click.native.prevent="insert(scope.row.FCATNO)" icon="el-icon-edit" type="text" size="small">
                查看详情
              </el-button>
            </template>
          </el-table-column>
        </JNPF-table>
        <pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" />
        <Form ref="Form" :parelist="list" />
      </div>
    </div>
  </div>
</template>

<script>
  import Form from "./Form.vue"
  export default {
    name: 'shop',
    components: { Form },
    data() {
      return {
        showAll:false,
        fstockname:"化学系仓库",
        url:require('@/assets/images/me/house.png'),

        fvisiblelist: [
          { id: "1", fullName: "有效" },
          { id: "0", fullName: "无效" },
        ],
        total: 0,
        list: [
        {
          "FWEIGHT":"250",
          "FNUM":3,
          "FCATNO":"851-001-01",
          "FCATNAME":"医疗废物",
          "FSTOCK":"化学系仓库",
          "FMEMO":"",
          "FVISIBLE":"1",
          "FOPERATOR": "system",
          "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
        },{
          "FWEIGHT":"346.8",
          "FNUM":5,
          "FCATNO":"851-001-01",
          "FCATNAME":"化学药品原料废物",
          "FSTOCK":"化学系仓库",
          "FMEMO":"",
          "FVISIBLE":"1",
          "FOPERATOR": "system",
          "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
        },{
          "FWEIGHT":"68.9",
          "FNUM":1,
          "FCATNO":"851-001-01",
          "FCATNAME":"生物实验废物",
          "FSTOCK":"生物系仓库",
          "FMEMO":"",
          "FVISIBLE":"1",
          "FOPERATOR": "system",
          "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
        },{
          "FWEIGHT":"129.50",
          "FNUM":2,
          "FCATNO":"851-001-01",
          "FCATNAME":"废弃药物",
          "FSTOCK":"生物系仓库",
          "FMEMO":"",
          "FVISIBLE":"1",
          "FOPERATOR": "system",
          "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
        }
        ],

        //所属教学楼选择数据
        options1: [{
          value: '20E01',
          label: '第一教学楼'
        }, {
          value: '20E02',
          label: '化学楼'
        }, {
          value: '20N03',
          label: '综合实验楼'
        }, {
          value: '20E04',
          label: '第二教学楼'
        }],

        options2: [{
          value: '1',
          label: '化学系仓库'
        }, {
          value: '2',
          label: '生物系仓库'
        }],

        loading: false,
        listQuery: {
          page: 1,
          limit: 20,
          sort: "desc",
          sidx: "",
          fcatno: "",
          fcatname: ""
        },
      };
    },
    computed: {},
    created() {
    },
    methods: {
      insert(row) {
        this.$refs.Form.init(row);
      },
    },
  };
</script>